<template>
  <f7-page>

    <f7-navbar title="发放列表" back-link="返回">
    </f7-navbar>

    <f7-list form>
    	<div>
        <span>本周发放{{total}}元</span>
        <span>截止:<myDatepicker @dtpkChange="driverDeadline" :date="date"></myDatepicker></span>

      </div>

		<f7-list-item v-for="x in redCardOrder">
			头像:{{x.user_photo}},
			姓名:{{x.user_name}}, 
			车牌:{{x.truck_num}},
			载重{{x.truck_weight}}
			发放日期{{x.time_creation}}
			发放金额{{x.money}}
			剩余金额{{x.money_remain}}
		</f7-list-item>

		<f7-list-item>{{redCardOrder}}</f7-list-item>
	</f7-list>


  </f7-page>
</template>

<script>
import myDatepicker from '../../components/datetimepicker'
  export default {
    name: 'trafficCouponLogSu',
    filters: {
      dateTime: function (value) {
        if (!value) return ''
        let time=new Date(value)
        return time.getFullYear() + '/' +(time.getMonth()+1) + '/'+time.getDate() 
      }
    },
    data () {
      return {
      	search_time: (new Date()),
        total:0,
        date:{time: this.$options.filters['dateTime'](new Date())},
        redCardOrder:''
      }
    },
    components: { myDatepicker },
    methods: {
      // 获取 /red_card_order_c/get_list
      async getPercentageCash(){

      	let param = this.$f7Route.params;

      	if(param.cardId){
      		let result = (await this.mineService.redCardOrderGetList({
	        	card_id: param.cardId,
	        	search_time: this.search_time
	        })).data.data;

          if(result){            
            this.redCardOrder=result.lists;

            this.total = result.week_money
          }
      	}
      },
      driverDeadline(v){
        this.search_time= (new Date(v)).getTime();
        this.getPercentageCash()
      }
    
    },
    mounted () {
      this.getPercentageCash()
    }
  }
</script>

<style scoped>
  .row {
    margin: 0px 10px;
  }

  .col-25 {
    float: left;
    text-align: center;
    position: relative;
    margin-bottom: 25px;
  }

  i.f7-icons {
    display: inherit;
    height: 30px;
  }

  .text-gray {
    font-family: verdana, 'Hiragino Sans GB', 'Microsoft Yahei', 微软雅黑,
    'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    font-weight: 400;
    margin-top: 7px;
    font-size: 12px;
  }

  .text-purple {
    color: #a3a2f0;
  }

  .ios .navbar .right {
    margin-left: 10px;
    color: #fff;
    font-size: 14px;
  }

  .bg-master {
    position: relative;
    background: url('../../assets/img/bg-master.jpg') no-repeat center -53px;
    background-size: 100% 150px;
    padding-bottom: 15px;
  }

  .bg-master h2 {
    color: #fff;
    font-size: 20px;
    white-space: normal;
    display: inherit;
    padding: 12px 0 9px 24px;
    margin: 0;
  }

  .bg-master h4 {
    color: #fff;
    font-size: 12px;
    white-space: normal;
    display: inherit;
    padding: 0px 0 30px 24px;
    margin: 0;
  }

  .role-icon {
    vertical-align: middle;
    background: #9db7ff;
    color: #fff;
    font-size: 12px;
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: 10px;
  }

  .logo-icon {
    position: absolute;
    right: 24px;
    top: 9px;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 100%;
    background: #f0f0f0;
  }

  .logo-icons {
    width: 48px;
    height: 48px;
    border-radius: 100%;
  }

  .ios .card {
    margin: 0 24px 20px 24px;
    padding: 10px 10px;
    border-radius: 5px;
  }

  .text-center_tite {
    font-size: 16px;
    color: #333;
  }

  .text-center_footer {
    font-size: 12px;
    color: #666;
  }

  .text-center_footer span {
    margin-right: 3px;
  }

  .ios .card-header,
  .ios .card-footer {
    min-height: 40px;
    padding: 0px 15px;
    position: initial;
  }

  .item-face {
    position: absolute;
    right: 15px;
    top: 5px;
  }

  .text-gray2 {
    color: #e5e5e5;
    font-size: 12px;
    display: inherit;
  }

  .ios .list {
    margin: 0;
  }

  .ios .page {
    background: #fff;
  }
</style>
